<%--
  Created by IntelliJ IDEA.
  User: 李杨洋
  Date: 2020/8/26
  Time: 16:45
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script src="${basePath}static/js/jquery-1.4.2.min.js"></script>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>购物车</title>
    <link rel="stylesheet" type="text/css" href="${basePath}static/css/style.css" />
    <link rel="stylesheet" type="text/css" href="${basePath}static/css/shopping-mall-index.css" />
    <script type="text/javascript" src="${basePath}static/js/jquery.js"></script>
    <script type="text/javascript" src="${basePath}static/js/zhonglin.js"></script>
    <script type="text/javascript" src="${basePath}static/js/zhongling2.js"></script>
</head>

<body style="position:relative;">

<!--header-->
<%@include file="index_linkPages/header.jsp"%>

<!--logo search weweima-->
<div class="logo-search w1200">
    <div class="logo-box f-l">
        <div class="logo f-l">
            <a href="index.html" title="中林logo"><img src="${basePath}static/images/zl2-01.gif" /></a>
        </div>
        <div style="clear:both;"></div>
    </div>
    <div class="erweima f-r">
        <a href="JavaScript:;"><img src="${basePath}static/images/zl2-04.gif" /></a>
    </div>
    <div class="search f-r">
    </div>
    <div style="clear:both;"></div>
</div>


<!--内容开始-->
<div class="cart-content w1200">
    <ul class="cart-tit-nav">
        <li class="current"><a href="#">全部商品   21</a></li>
        <div style="clear:both;"></div>
    </ul>
    <div class="cart-con-tit">
        <p class="p1">
            <input type="hidden" value="" name="hobby"></input>
        </p>
        <p class="p2">商品信息</p>
        <p class="p4">数量</p>
        <p class="p5">单价（元）</p>
        <p class="p6">金额（元）</p>
        <p class="p7">操作</p>
    </div>

    <c:forEach items="${shoppCarts}" var="shoppCart">
    <div class="cart-con-info">
        <input type="hidden" name="id" id="id" value="${commodity.id}"/>
    </div>
    <div class="cart-con-info">
        <div class="info-top">
            <span>商家：${shoppCart.merchantName}</span>
        </div>
        <div class="info-mid">
            <input type="checkbox" value="" name="hobby" class="mid-ipt f-l"></input>
            <div class="mid-tu f-l">
                <a href="#"><img src="${basePath}commodityDp?method=showPic&pic=${shoppCart.pic}" /></a>
            </div>
            <div class="mid-font f-l">
                <a href="#">${shoppCart.commName}<br />
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </a>

            </div>
            <div class="mid- f-l">
            </div>
            <div class="mid-sl f-l">
                <a href="JavaScript:;" class="sl-left">-</a>
                <input type="text" id="number" value="${shoppCart.number}" />
                <a href="JavaScript:;" class="sl-right">+</a>
            </div>
            <p class="mid-dj f-l">¥ <span>${shoppCart.price}</span></p>
            <p class="mid-je f-l">¥ <span>${shoppCart.sum}</span></p>
            <div class="mid-chaozuo f-l">
                <button onclick="toPay('${shoppCart.id}')">购买</button>
                <button onclick="delShoppCart('${shoppCart.id}')">删除</button>
            </div>
            <div style="clear:both;"></div>
        </div>
    </div>
    </c:forEach>
    <div class="cart-con-footer">
        <div class="quanxuan f-l">
            <input type="checkbox" value="" name="hobby"></input>
            <span>全选</span>
            <a href="#">删除</a>
            <a href="#">购买</a>
            <p>（此处始终在屏幕下方）</p>
        </div>
        <div class="jiesuan f-r">
            <div class="jshj f-l">
                <p>合计（不含运费）</p>
                <p class="jshj-p2">
                    ￥：<span>0</span>.00
                </p>
            </div>
            <a href="payInterface.jsp;" class="js-a1 f-l">结算</a>
            <div style="clear:both;"></div>
        </div>
        <div style="clear:both;"></div>
    </div>
</div>

<!--底部一块-->
<div class="footer-box">
    <div class="footer-info3 w1200">
        <p>
            <a href="#">免责条款</a><span>|</span>
            <a href="#">隐私保护</a><span>|</span>
            <a href="#">咨询热点</a><span>|</span>
            <a href="#">联系我们</a><span>|</span>
            <a href="#">公司简介</a>
        </p>
        <p>
            <a href="#">沪ICP备13044278号</a><span>|</span>
            <a href="#">合字B1.B2-20130004</a><span>|</span>
            <a href="#">营业执照</a><span>|</span>
            <a href="#">互联网药品信息服务资格证</a><span>|</span>
            <a href="#">互联网药品交易服务资格证</a>
        </p>
        <div class="ft-if3-tu1">
            <a href="#"><img src="${basePath}static/images/zl2-91.gif" /></a>
            <a href="#"><img src="${basePath}static/images/zl2-92.gif" /></a>
            <a href="#"><img src="${basePath}static/images/zl2-93.gif" /></a>
        </div>
    </div>
</div>
</body>
<script>
    function toPay(id) {
        let number = document.getElementById("number").value;
        window.location.href = "${basePath}purchase?method=toPay&id="+id+",${sessionScope.user.username},"+number;
    }
    function delShoppCart(id) {
        window.location.href = "${basePath}purchase?method=delShoppCart&id="+id+",${sessionScope.user.username}";
    }
</script>
</html>

